#/bin/bash
WORK_PATH1='/app/node/project-data-visualization/dynamic_pic_draw_behind/'
WORK_PATH2='/app/node/project-data-visualization/dynamic_pic_draw/'
echo "先清除老代码"
git reset --hard origin/master
git clean -f
echo "拉取最新代码"
git pull origin master


echo "停止并删除旧容器"
docker stop vue-front-container 
docker rm vue-front-container

docker stop vue-back-container 
docker rm vue-back-container

echo "清除旧镜像"
docker rmi -f vue-back
docker rmi -f vue-front

cd $WORK_PATH1
echo "开始执行构建后端镜像"
docker build -t vue-back .
cd $WORK_PATH2
echo "开始执行构建前端镜像"
docker build -t vue-front .


echo "启动新容器"
docker compose -f /app/myconf/warningSystem.yaml up -d